home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
amok_lha
/
amok03.lha
/
IFFLoad_1.1
/
DiaShow.mod
< prev
next >
Wrap
Text File
|
1993-08-15
|
4KB
|
133 lines
(*---------------------------------------------------------------------------
:Program. ShowIFF.mod
:Author. Fridtjof Siebert
:Address. Nobileweg 67, D-7-Stgt-40
:Phone. 0711/822509
:Shortcut. [fbs]
:Version. 1.0
:Date. 20.04.88
:Copyright. PD
:Language. Modula-II
:Translator. M2Amiga
:Imports. IFFLoad [fbs].
:UpDate. none.
:Contents. IFF-Ladeprogramm zum Betrachten von IFF (ILBM)-Bildern.
:Remark. Wieso kann M&T die Compression nicht erklären ???
---------------------------------------------------------------------------*)
MODULE DiaShow;
FROM SYSTEM IMPORT ADR, CAST, SHIFT, BITSET;
FROM Intuition IMPORT ScreenPtr,ScreenToFront,CloseScreen,CurrentTime,
WindowPtr;
FROM Graphics IMPORT WaitTOF,LoadRGB4,SetRGB4,ViewModes;
FROM Arguments IMPORT NumArgs,GetArg;
FROM Conversions IMPORT StrToVal;
FROM IFFLoad IMPORT ReadILBM,ReadILBMFlags,ReadILBMFlagSet,IFFInfoTypePtr,
IFFInfoType,IFFInfo;
VAR
Screen1,Screen2: ScreenPtr;
WindowDummy: WindowPtr;
Info1,Info2: IFFInfoType;
Name: ARRAY[0..79] OF CHAR;
length: INTEGER;
i,j: CARDINAL;
ok,Error: BOOLEAN;
Seconds,Micros: LONGINT;
SecondsToWait,Secs: LONGINT;
LastSeconds: LONGINT;
Ciapra [0BFE001H]: SET OF (s0,s1,s2,s3,s4,s5,lmb);
n,m: CARDINAL;
PROCEDURE DimOff(Screen: ScreenPtr; Info: IFFInfoTypePtr);
BEGIN
WITH Screen^ DO
IF NOT(ham IN viewPort.modes) THEN
WITH Info^.CMAP DO
FOR m:=15 TO 0 BY -1 DO
FOR n:=0 TO colorCnt-1 DO
SetRGB4(ADR(viewPort),n,SHIFT(red [n]*m,-4),
SHIFT(green[n]*m,-4),
SHIFT(blue [n]*m,-4));
END;
WaitTOF;
END;
END;
END;
END;
END DimOff;
PROCEDURE DimOn(Screen: ScreenPtr; Info: IFFInfoTypePtr);
VAR
front: BOOLEAN;
BEGIN
front := FALSE;
WITH Screen^ DO
IF NOT(ham IN viewPort.modes) THEN
WITH Info^.CMAP DO
FOR m:=1 TO 16 DO
FOR n:=0 TO colorCnt-1 DO
SetRGB4(ADR(viewPort),n,SHIFT(red [n]*m,-4),
SHIFT(green[n]*m,-4),
SHIFT(blue [n]*m,-4));
END;
IF NOT(front) THEN
ScreenToFront(Screen);
front := TRUE;
END;
WaitTOF;
END;
END;
ELSE
ScreenToFront(Screen);
END;
END;
END DimOn;
BEGIN
i := NumArgs();
j := 1;
Screen2 := NIL;
SecondsToWait := 20;
WHILE j<=i DO
GetArg(j,Name,length);
ok:=FALSE;
StrToVal(Name,Secs,ok,10,Error);
IF NOT(Error) THEN
SecondsToWait := Secs;
ELSE
IF ReadILBM(Name,ReadILBMFlagSet{visible},Screen1,WindowDummy) THEN
Info1 := IFFInfo;
IF Screen2#NIL THEN
REPEAT
CurrentTime(ADR(Seconds),ADR(Micros));
UNTIL (Seconds-SecondsToWait>=LastSeconds) OR NOT(lmb IN Ciapra);
DimOff(Screen2,ADR(Info2));
END;
DimOn(Screen1,ADR(Info1));
CurrentTime(ADR(Seconds),ADR(Micros));
LastSeconds := Seconds;
IF Screen2#NIL THEN CloseScreen(Screen2) END;
Screen2 := Screen1;
Info2 := Info1;
ELSE
Screen1 := NIL;
END;
END;
INC(j);
END;
IF Screen2#NIL THEN
REPEAT
CurrentTime(ADR(Seconds),ADR(Micros));
UNTIL (Seconds-SecondsToWait>=LastSeconds) OR NOT(lmb IN Ciapra);
DimOff(Screen2,ADR(Info2));
CloseScreen(Screen2);
END;
END DiaShow.